local LUF = LibStub("AceAddon-3.0"):GetAddon("lUnitFrame")
local db
local options 
local EliteTexture ={
"Interface\\TargetingFrame\\UI-TargetingFrame",
"Interface\\TargetingFrame\\UI-TargetingFrame-Rare-Elite",
"Interface\\TargetingFrame\\UI-TargetingFrame-Elite",
"Interface\\Addons\\lUnitFrame\\Texture\\UI-TargetingFrame-Skeleton.blp"
 }


local MODNAME = "EliteFrame"
local mod = LUF:NewModule(MODNAME, "AceEvent-3.0")

local function getOptions()
	if not options then
		options ={
			type = "group",
			name = MODNAME,
			arg = MODNAME,
			args = {
				EliteType = {
					type = "range",
					name = 	"EliteType",
					desc = "select eliteframe",
					get = function() return db.EliteType end,
					set = function(info,v ) 
						db.EliteType = v
						mod:Update()
					end,
					min = 1,max = 4 ,step = 1,
				}
			}
			
		}
	end
	return options
end


function mod:print(t)
DEFAULT_CHAT_FRAME:AddMessage(t)
end
function mod:OnInitialize()
	self.db = LUF.db:RegisterNamespace(MODNAME)
    self.db:RegisterDefaults({
        profile = {
			EliteType = 1
		},
    })
	db = self.db.profile
	LUF:RegisterModuleOptions(MODNAME, getOptions)
end



function mod:OnEnable()
	--self.print(MODNAME.." is loaded")
	DEFAULT_CHAT_FRAME:AddMessage(MODNAME.." Module is enable")
	self:RegisterEvent("PLAYER_LEVEL_UP");
	PlayerFrame:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", 0, -4);
	self:Update()
    
end

function mod:PLAYER_LEVEL_UP()
TakeScreenshot();
end

function mod:Update()
PlayerFrameTexture:SetTexture(EliteTexture[db.EliteType]);
end


